﻿<%@ Page Title="" Language="C#" MasterPageFile="~/FrontEnd.master" AutoEventWireup="true" CodeFile="~/Code/Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="GMaps" Namespace="Subgurim.Controles" TagPrefix="cc1" %>

<%-- Add content controls here --%>
<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="cp_Page_Heading">
    Welcome to P.A.N.D.A. - Please find the 5 Most Recent Incidents Below 
</asp:Content>

<asp:Content ID="Content2" runat="server" 
    contentplaceholderid="cp_Major_Content">

    For a complete list of incidents, please click
    <asp:LinkButton ID="link_text" runat="server" onclick="link_text_Click">here</asp:LinkButton>
    <br />

    <br />
    <cc1:GMap ID="GMap" runat="server" />
    <asp:RadioButtonList ID="rb_states_List" runat="server" AutoPostBack="True" RepeatDirection="Horizontal"
        Width="100%" OnSelectedIndexChanged="rb_states_List_Changed">
        <asp:ListItem Value="AUSTRALIA" Selected="True">AUS</asp:ListItem>
        <asp:ListItem Value="QUEENSLAND">QLD</asp:ListItem>
        <asp:ListItem Value="NEW SOUTH WALES">NSW</asp:ListItem>
        <asp:ListItem Value="TASMANIA">TAS</asp:ListItem>
        <asp:ListItem Value="VICTORIA">VIC</asp:ListItem>
        <asp:ListItem Value="SOUTH AUSTRALIA">SA</asp:ListItem>
        <asp:ListItem Value="WESTERN AUSTRALIA">WA</asp:ListItem>
        <asp:ListItem Value="NORTHERN TERRITORY">NT</asp:ListItem>
    </asp:RadioButtonList>
    <br />
    <br />


    <asp:ListView ID="public_Lv" runat="server" DataSourceID="public_ListIncidents" 
        onselectedindexchanged="public_Lv_SelectedIndexChanged" OnDataBound="public_Lv_Databound">
    <AlternatingItemTemplate>
        <span style="background-color: #FFF8DC;">Type:
        <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' />
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Eval("Description") %>' />
        <br />
        Landmark:
        <asp:Label ID="LandmarkLabel" runat="server" Text='<%# Eval("Landmark") %>' />
        <br />
        City:
        <asp:Label ID="CityLabel" runat="server" Text='<%# Eval("City") %>' />
        <br />
        State_Name:
        <asp:Label ID="State_NameLabel" runat="server" 
            Text='<%# Eval("State_Name") %>' />
        <br />
        Date_Reported:
        <asp:Label ID="Date_ReportedLabel" runat="server" 
            Text='<%# Eval("Date_Reported") %>' />
        <br />
        <br />
        </span>
    </AlternatingItemTemplate>
    <EditItemTemplate>
        <span style="background-color: #008A8C;color: #FFFFFF;">Type:
        <asp:TextBox ID="TypeTextBox" runat="server" Text='<%# Bind("Type") %>' />
        <br />
        Description:
        <asp:TextBox ID="DescriptionTextBox" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />
        Landmark:
        <asp:TextBox ID="LandmarkTextBox" runat="server" 
            Text='<%# Bind("Landmark") %>' />
        <br />
        City:
        <asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' />
        <br />
        State_Name:
        <asp:TextBox ID="State_NameTextBox" runat="server" 
            Text='<%# Bind("State_Name") %>' />
        <br />
        Date_Reported:
        <asp:TextBox ID="Date_ReportedTextBox" runat="server" 
            Text='<%# Bind("Date_Reported") %>' />
        <br />
        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
            Text="Update" />
        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
            Text="Cancel" />
        <br />
        <br />
        </span>
    </EditItemTemplate>
    <EmptyDataTemplate>
        <span>No data was returned.</span>
    </EmptyDataTemplate>
    <InsertItemTemplate>
        <span style="">Type:
        <asp:TextBox ID="TypeTextBox" runat="server" Text='<%# Bind("Type") %>' />
        <br />
        Description:
        <asp:TextBox ID="DescriptionTextBox" runat="server" 
            Text='<%# Bind("Description") %>' />
        <br />
        Landmark:
        <asp:TextBox ID="LandmarkTextBox" runat="server" 
            Text='<%# Bind("Landmark") %>' />
        <br />
        City:
        <asp:TextBox ID="CityTextBox" runat="server" Text='<%# Bind("City") %>' />
        <br />
        State_Name:
        <asp:TextBox ID="State_NameTextBox" runat="server" 
            Text='<%# Bind("State_Name") %>' />
        <br />
        Date_Reported:
        <asp:TextBox ID="Date_ReportedTextBox" runat="server" 
            Text='<%# Bind("Date_Reported") %>' />
        <br />
        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
            Text="Insert" />
        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
            Text="Clear" />
        <br />
        <br />
        </span>
    </InsertItemTemplate>
    <ItemTemplate>
        <span style="background-color: #DCDCDC;color: #000000;">Type:
        <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' />
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Eval("Description") %>' />
        <br />
        Landmark:
        <asp:Label ID="LandmarkLabel" runat="server" Text='<%# Eval("Landmark") %>' />
        <br />
        City:
        <asp:Label ID="CityLabel" runat="server" Text='<%# Eval("City") %>' />
        <br />
        State_Name:
        <asp:Label ID="State_NameLabel" runat="server" 
            Text='<%# Eval("State_Name") %>' />
        <br />
        Date_Reported:
        <asp:Label ID="Date_ReportedLabel" runat="server" 
            Text='<%# Eval("Date_Reported") %>' />
        <br />
        <br />
        </span>
    </ItemTemplate>
    <LayoutTemplate>
        <div style="font-family: Verdana, Arial, Helvetica, sans-serif;" 
            ID="itemPlaceholderContainer" runat="server">
            <span runat="server" id="itemPlaceholder" />
        </div>
        <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
        </div>
    </LayoutTemplate>
    <SelectedItemTemplate>
        <span style="background-color: #008A8C;font-weight: bold;color: #FFFFFF;">Type:
        <asp:Label ID="TypeLabel" runat="server" Text='<%# Eval("Type") %>' />
        <br />
        Description:
        <asp:Label ID="DescriptionLabel" runat="server" 
            Text='<%# Eval("Description") %>' />
        <br />
        Landmark:
        <asp:Label ID="LandmarkLabel" runat="server" Text='<%# Eval("Landmark") %>' />
        <br />
        City:
        <asp:Label ID="CityLabel" runat="server" Text='<%# Eval("City") %>' />
        <br />
        State_Name:
        <asp:Label ID="State_NameLabel" runat="server" 
            Text='<%# Eval("State_Name") %>' />
        <br />
        Date_Reported:
        <asp:Label ID="Date_ReportedLabel" runat="server" 
            Text='<%# Eval("Date_Reported") %>' />
        <br />
        <br />
        </span>
    </SelectedItemTemplate>
    
    </asp:ListView>
    <br />


    <asp:AccessDataSource ID="public_ListIncidents" runat="server" 
    DataFile="~/App_Data/Database.accdb" 
    
        
        
        SelectCommand="SELECT TOP 5 Incidents.Type, Incidents.Description, Incidents.Landmark, Incidents.City, State.State_Name, Incidents.[Date Reported] AS Date_Reported FROM (Incidents INNER JOIN State ON Incidents.State = State.State_ID) WHERE (Incidents.[Date Resolved] IS NULL) AND (Incidents.Status = 'Active') ORDER BY Incidents.[Date Reported] DESC">
    </asp:AccessDataSource>


    </asp:Content>






